#
import math
import numpy as np

class Radar(object):
    def power_aperture(snr, tsc, sigma, range, te, nf, loss, az_angle, el_angle):
        '''
        This program implements Eq. (1.67)
        '''
        Tsc = 10 * np.log10(tsc)
        Sigma = 10 * np.log10(sigma)
        four_pi = 10 * np.log10(4.0 * np.pi)
        k_db = 10 * np.log10(1.38e-23)
        Te = 10 * np.log10(te)
        range_pwr4_db = 10 * np.log10(range ** 4)
        omega = az_angle * el_angle / (57.296) ** 2
        Omega = 10 * np.log10(omega)

        PAP = snr + four_pi + k_db + Te + nf + loss + range_pwr4_db + Omega - Sigma - Tsc
        return PAP
